import { BasicColumn, FormSchema } from '/@/components/Table';
import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n('monitor.route.fields');
const { t: common } = useI18n('common');
export const routerFields = {
  routerId: t('routerId'),
  name: t('name'),
  uri: t('uri'),
  status: t('status'),
  predicates: t('predicates'),
  filter: t('filter'),
};
export const columns: BasicColumn[] = [
  {
    title: routerFields.routerId,
    dataIndex: 'routerId',
    width: 200,
    align: 'left',
  },
  {
    title: routerFields.name,
    dataIndex: 'name',
    width: 200,
  },
  {
    title: routerFields.uri,
    dataIndex: 'uri',
    width: 200,
  },
  {
    title: routerFields.status,
    dataIndex: 'status',
    slots: { customRender: 'status' },
    width: 200,
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'name',
    label: routerFields.routerId,
    component: 'Input',
    required: true,
  },
  {
    field: 'name',
    label: routerFields.name,
    component: 'InputNumber',
    required: true,
  },
  {
    field: 'uri',
    label: routerFields.uri,
    component: 'Input',
  },
  {
    field: 'predicates',
    label: routerFields.predicates,
    slot: 'predicates',
    component: 'Input',
  },
];
